package com.tanhua.dubbo.api;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.api.R;
import com.tanhua.dubbo.mappers.ProblemMapper;
import com.tanhua.model.soul.Problem;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
@DubboService
public class ProblemApiImpl implements ProblemApi {
    @Autowired
    private ProblemMapper problemMapper;

    @Override
    public List<Problem> findProblemId(Long listId) {
        LambdaQueryWrapper<Problem> queryWrapper=new LambdaQueryWrapper<>();

        queryWrapper.eq(Problem::getListId,listId);
        List<Problem> problems = problemMapper.selectList(queryWrapper);
        return problems;


    }

    @Override
    public Problem findById(Long id) {
        return problemMapper.selectById(id);
    }
}
